﻿package flow {
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	public class InfoBg extends MovieClip {
		public function InfoBg() {
			this.addEventListener(Event.ADDED_TO_STAGE, this_addedToStage);
		}
		
		private var _showHide:Boolean = false;
		
		private function this_addedToStage(e:Event){
			this.width = stage.stageWidth;
			this.height = stage.stageHeight;
			
			stage.addEventListener(Event.RESIZE, stage_resize);
			this.addEventListener(MouseEvent.CLICK, this_click);
		}
		
		private function stage_resize(e:Event){
			this.width = stage.stageWidth;
			this.height = stage.stageHeight;
		}
		
		private function this_click(e:MouseEvent){
			_showHide = !_showHide;
			if(_showHide){
				this.dispatchEvent(new Event("info-show"));
			} else {
				this.dispatchEvent(new Event("info-hide"));
			}
		}
	}
}
